$(function(){
	$("#select").on('click',function(data){
		var keys = new Array();
		// Get All selected Lines
		$("#bd_gRessource input[type=checkbox]:checked").each(function() {
			keys.push($(this).parents('tr:first').metadata().key);
		});
		if(keys.length == 0) {
			return false;
		}
		var keys = JSON.stringify(keys);
		var timestamp = Math.round((new Date(2009,0,1)).getTime()/1000);
		$.ajax({
			type: "POST",
			url: "?mod=ressource&act=carousel&sac=build&xvtrs=none",
			data : "&data="+keys+"&carouselid="+timestamp,
			success: function(data)
			{
				window.location.assign("?mod=ressource&act=carousel&carouselid="+timestamp);
			}	
		});
	});

});